# -*- coding: utf-8 -*-
# @Time: 2025/4/19 9:24
# @Author: SimpleTree

from common.constants.cache_code_constants import CacheCodeConstants
from common.util.cache_util import get_cache


# 匿名函数可以根据函数的实际输入动态生成缓存键
@get_cache(cache_key=lambda index_path: index_path,
           version=CacheCodeConstants.STATIC_RESOURCE_CACHE.value)
def get_index_html(index_path):
    file = open(index_path, "r", encoding="utf-8")
    content = file.read()
    file.close()
    return content
